<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>路由</title>
		<script src="../js/vue.js"></script>
		<script src="../js/vue-router.js"></script>
	</head>
	<body>
		<div id="app">
			<h1>当前页</h1>
			<router-link to="/home">点击回到</router-link>
			<router-view></router-view>
		</div>
		
		<template id="temp">
			<div>
				<h1>路由中的组件</h1>
			</div>
		</template>
		
		<script>
		let HomeCom = {
			template:"#temp"
		}
		let router = new VueRouter({
			routes:[
				{path:"/home",component:HomeCom}
			]
		})
		const app = new Vue({
			el:"#app",
			router
		})
		</script>
	</body>
</html>
